package com.hill;

class SpaceShipControls{
    void up (int velocity) {}
    void down ( int velocity){}
    void left( int velocity){}
    void right (int velocity){ }
    void forward ( int velocity){
        System.out.println("向前：" + velocity);
    }
    void back (int velocity) {}
    void turboBoost() {}
}

public class SpaceDelegation {
    private String name;
    private SpaceShipControls controls=new  SpaceShipControls();
    public SpaceDelegation(String name){
        this.name=name;
    }
    //delegate method
    public void back (int velocity){
        controls.back(velocity);
    }
    public void down ( int velocity ) {
        controls.down (velocity);
    }
    public void forward ( int velocity ){
        controls.forward ( velocity ) ;
    }
    public void left ( int velocity ) {
        controls. left (velocity ) ;
    }
    public void right ( int velocity) {
        controls.right ( velocity) ;
    }
    public void turboBoost(){
       controls.turboBoost();
    }
    public void up ( int velocity) {
        controls.up(velocity);
    }

    public static void main(String[] args) {
        SpaceDelegation nsea_protector = new SpaceDelegation("NSEA protector");
        nsea_protector.forward(100);
    }
}
